<%@ page language="java" pageEncoding="UTF-8"%>
<%@include file="/global/global-head.jsp" %>
<!DOCTYPE html>
<html lang="zh">
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<title>吉车惠后台管理系统</title>
	<%@include file="/global/global-other.jsp" %>
<script type="text/javascript">
	var $bn_oilStaion_worker_list = new Object();
	var $bn_oilStaion_worker_list_Datagrid;
	var $bn_oilStaion_worker_list_toolbar = [{
		text:'<i class="fa fa-search " aria-hidden="true"></i>查询',
		handler:function(){
			$bn_oilStaion_worker_list.reload();
		}
	},
		{
			text:'<i class="fa fa-hand-o-up" aria-hidden="true"></i>业务受理',
			handler:function(){
				$bn_oilStaion_worker_list.updateInit();
			}
		},
		{
			text:'<i class="fa fa-file-text-o" aria-hidden="true"></i>详细信息',
			handler:function(){
				$bn_oilStaion_worker_list.detailed();
			}
		}
	];
	$(function(){
		$bn_oilStaion_worker_list_Datagrid = $('#bn_oilStaionDatagrid').datagrid({
			filterBtnIconCls:'icon-filter',
			queryParams: {
				filter_EQ_delete_status: 0
			},
			pageSize : 20,
			remoteFilter:true
		});
		$bn_oilStaion_worker_list_Datagrid.datagrid('enableFilter', [
			{field:'phone',type:'text'},
			{field:'backContent',type:'text'},
			{field:'backAt',type:'text'},
			{field:'replyContent',type:'text'},
			{field:'replyAt',type:'text'},
			{field:'replyBy',type:'text'},
			{
				field:'isAccept',
				type:'combobox',
				options:{
					valueField: 'code',
					textField: 'name',
					url:'${ctx}/tcode/all/method?method=getCaheCdIsAccept'
				},
				op:['equal']
			}

		]);

	});


	$bn_oilStaion_worker_list.test=function(a){

	}

	$bn_oilStaion_worker_list.reload = function(){
		$("#bn_oilStaionDatagrid").datagrid('reload');
	};

	var viewDialog = null;
	$bn_oilStaion_worker_list.detailed = function(){
		var row = $bn_oilStaion_worker_list_Datagrid.datagrid('getSelected');
		if(row==null){
			$.messager.alert("提示",errMsg("请选择一行数据！"),"error");
		}else{

			viewDialog = parent.$.dialog({
				title: '<i class="fa fa-th-large"></i><span class="dialog-title">&nbsp;反馈详情<span>',
				href: '${ctx}/an/feed/update?_m=detailed&id='+row.id+'&r='+Math.random(),
				width: 900,
				height: 540,
				modal: true,
				onClose : function() {
					$(this).dialog('destroy');
				},
				buttons:[{
					text:'<i class="fa fa-reply" aria-hidden="true"></i>返回',
					width:'70px',
					handler:function(){
						viewDialog.dialog('destroy');
					}
				}]
			});
		}
	}

	//编辑
	$bn_oilStaion_worker_list.updateInit = function (){
		var row = $bn_oilStaion_worker_list_Datagrid.datagrid('getSelected');
		if(row==null){
			$.messager.alert("提示",errMsg("请选择一行数据！"),"error");
		}else if(row.isAccept !=0 ){
			$.messager.alert("提示",errMsg("此条数据已经进行回复！"),"error");
		}
		else{

			viewDialog = parent.$.dialog({
				title: '<i class="fa fa-th-large"></i><span class="dialog-title">&nbsp;业务受理<span>',
				href: '${ctx}/an/feed/update?_m=init&id='+row.id+'&r='+Math.random(),
				width: 900,
				height: 540,
				modal: true,
				onClose : function() {
					$(this).dialog('destroy');
				},
				buttons:[{
					text:'<i class="fa fa-floppy-o" aria-hidden="true"></i>保存',
					width:'70px',
					handler:function(){
						viewDialog.find('iframe').get(0).contentWindow.submitForm(viewDialog, $bn_oilStaion_worker_list_Datagrid);
					}
				},{
					text:'<i class="fa fa-reply" aria-hidden="true"></i>返回',
					width:'70px',
					handler:function(){
						viewDialog.dialog('destroy');
					}
				}]
			});
		}
	}
	$bn_oilStaion_worker_list.delete = function (){
	}


</script>
	</head>
<body>
<div class="easyui-layout" data-options="fit:true">
	<div data-options="region:'center',border:false">
<table id="bn_oilStaionDatagrid"  style="width:100%;height: 100%"
	   data-options="border:false,rownumbers:true,autoRowHeight:false,singleSelect:true,pagination:true,sortName:'backAt',sortOrder:'desc',toolbar:$bn_oilStaion_worker_list_toolbar,rowStyler: function(index,row){return {style:'height:30px'};},url:'${ctx}/an/feed/search?_m=load',method:'post'">
	<thead>
	<tr>
		<th data-options="field:'phone',width:120,align:'center'">app用户</th>
		<th data-options="field:'backContent',width:150,align:'center'">反馈内容</th>
		<th data-options="field:'backAt',width:150,align:'center'">反馈时间</th>
		<th data-options="field:'replyContent',width:120,align:'center'">回复内容</th>
		<th data-options="field:'replyAt',width:150,align:'center'">回复时间</th>
		<th data-options="field:'replyBy',width:80,align:'center'">回复人</th>
		<th data-options="field:'isAccept',width:120,align:'center',formatter:function(value,row,index){return row.isAcceptName;}">是否采纳</th>
	</tr>
	</thead>
</table>
</div>
	</div>
</body>
</html>